﻿<%@ Page Title="" Language="C#" MasterPageFile="~/uc/MemberIndex.Master" AutoEventWireup="true" CodeBehind="message.aspx.cs" Inherits="ncp.Web.member.message" %>
<%@ Import Namespace="ncp.Business" %>
<%@ Register TagPrefix="webdiyer" Namespace="Wuqi.Webdiyer" Assembly="AspNetPager, Version=7.3.2.0, Culture=neutral, PublicKeyToken=fb0a0fe055d40fd4" %>
<asp:Content ID="Content1" ContentPlaceHolderID="header" runat="server">
<title>信息管理-中国农业信息化服务商</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div class="bh-con-right-h-yy"><span>信息管理</span> > 
    <asp:Label ID="lbTitle" runat="server" Text="客户留言"></asp:Label></div>
    <ul class="membermsg">
    <asp:Repeater ID="repMsg" runat="server">
            <ItemTemplate>
            <li id="list<%#Eval("Message_Id") %>">
                <%if (Request.QueryString["role"].ToString() == "index")
                  {%>
                <div class="msgtitle">客户姓名：<%#Eval("Message_Name")%> &nbsp;&nbsp;<a style="color:Red;font-weight:normal;" href="javascript:void(0)" onclick="onDelete('<%#Eval("Message_Id") %>')">删除</a></div>
                <div class="caption">联系电话：<%#Eval("Message_Tel")%>&nbsp;电子邮箱：<%#Eval("Message_Email")%></div>
                <div class="caption"> 发布于 <%#Eval("Message_Date", "{0:yyyy-MM-dd HH:mm}")%></div>
                <div class="content"><%#Eval("Message_Note")%></div>
                <% }
                  else
                  {%>
                  <div class="msgtitle">客户姓名：<%#Eval("Client_Name")%></div>
                <div class="caption">联系电话：<%#Eval("Message_Tel")%>&nbsp;电子邮箱：<%#Eval("Message_Email")%></div>
                  <div class="caption"> 发布于 <%#Eval("Message_Date", "{0:yyyy-MM-dd HH:mm}")%></div>
                  <div class="content"><%#Eval("Message_Note")%></div>
                      <%}%>
            </li>
            </ItemTemplate>
            <FooterTemplate>
                <asp:Literal ID="ltEmpty" Text="<table style='border:none;width:100%'><tr><td style='text-align:center;height:40px;'>没有找到相关内容！</td></tr></table>" runat="server" Visible='<%#bool.Parse((repMsg.Items.Count==0).ToString())%>'></asp:Literal>
            </FooterTemplate>
        </asp:Repeater>
</ul>
<webdiyer:aspnetpager id="AspNetPager1" runat="server"  CssClass="anpager" CurrentPageButtonClass="cpb"
         onpagechanged="AspNetPager1_PageChanged" UrlPageIndexName="pageindex" EnableUrlRewriting="true" UrlRewritePattern="/member/message/%role%/{0}.html"
        CustomInfoHTML="<p>第<span>%CurrentPageIndex%</span>页，共<span>%PageCount%</span>页，每页显示<span>%PageSize%</span>条</p>"
    Width="100%" HorizontalAlign="right" AlwaysShowFirstLastPageNumber="true" PageSize="10" FirstPageText="首页" 
        LastPageText="尾页" NextPageText="下一页" PrevPageText="上一页"></webdiyer:aspnetpager> 
        <script type="text/javascript">
            function onDelete(messageId) {
                if (confirm("你确定要删除该条留言吗？")) {
                    var response = ncp.Web.member.message.onDeleteMsg(messageId);
                    if (response.value != null) {
                        var jsonOBJ = eval(response.value)[0];
                        alert(jsonOBJ.msg);
                        if (jsonOBJ.isreload) {
                            $("#list" + messageId).remove();
                        }

                    }
                }
            }
</script>
</asp:Content>
